Thompson Shell
   HOME

TheInfoList



OR:

The Thompson shell was the first
Unix shell A Unix shell is a command-line Interpreter (computing), interpreter or shell (computing), shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting langua ...
, introduced in the first version of
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
in 1971, and was written by
Ken Thompson Kenneth Lane Thompson (born February 4, 1943) is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B programmi ...
. It was a simple command interpreter, not designed for scripting, but nonetheless introduced several innovative features to the
command-line interface A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
and led to the development of the later Unix shells.


History

The name "shell" for a
command-line interpreter A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
and the concept of making the shell a user program outside of the operating system
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
were introduced in Unix's precursor
Multics Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing operating system based on the concept of a single-level memory.Dennis M. Ritchie, "The Evolution of the Unix Time-sharing System", Communications of t ...
. An early feature of the Thompson shell was a compact syntax for input/output redirection. In Multics, redirecting the input or output of a command required separate commands to start and stop redirection; in Unix, one could simply add an argument to the command line consisting of the < symbol followed by a filename for input or the > symbol for output, and the shell would redirect I/O for the duration of the command. This syntax was already present by the release of the first version of Unix in 1971. A later addition was the concept of
pipes Pipe(s), PIPE(S) or piping may refer to: Objects * Pipe (fluid conveyance), a hollow cylinder following certain dimension rules ** Piping, the use of pipes in industry * Smoking pipe ** Tobacco pipe * Half-pipe and quarter pipe, semi-circula ...
. At the suggestion of
Douglas McIlroy Malcolm Douglas McIlroy (born 1932) is a mathematician, engineer, and programmer. As of 2019 he is an Adjunct Professor of Computer Science at Dartmouth College. McIlroy is best known for having originally proposed Unix pipelines and developed se ...
, the redirection syntax was expanded so that the output of one command could be passed to the input of another command. The original pipe syntax, as described in the Version 3 manual, was: command1 >command2> This syntax proved too ambiguous and was easily confused with redirection to and from files—the system cannot tell if "command2" is the command "command2" or the file "command2". By Version 4, the syntax had changed to use both the , and ^ symbols to denote pipes: command1 , command2 This produces exactly the same result as: command1 ^ command2 The > symbol changed into: command1 > file1 This would put the output of command1 into file1. The Thompson shell syntax for redirection with < and >, and piping with , , has proven durable and has been adopted by most other Unix shells and command shells of several other operating systems, most notably on
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
,
OS/2 OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 ...
and
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
.


Decline and replacements

The shell's design was intentionally minimalistic; even the ''if'' and ''goto'' statements, essential for control of program flow, were implemented as separate commands. As a result, by the 1975 release of
Version 6 Unix Sixth Edition Unix, also called Version 6 Unix or just V6, was the first version of the Unix operating system to see wide release outside Bell Labs. It was released in May 1975 and, like its direct predecessor, targeted the DEC PDP-11 family of ...
, it was becoming clear that the Thompson shell was inadequate for most serious programming tasks. At this time, the developers of the Programmer's Workbench UNIX distribution, most notably
John Mashey John R. Mashey (born 1946) is an American computer scientist, director and entrepreneur. Career Mashey holds a Ph.D. in computer science from Pennsylvania State University, where he developed the ASSIST assembler language teaching software. He wo ...
, began modifying the Thompson shell to make it more suitable for programming. The result, known as the
PWB shell The PWB shell (also known as the Mashey shell) was a Unix shell. History The PWB shell was a modified (and generally constrained to be upward-compatible) version of the Thompson shell with additional features to increase usability for programmin ...
or the Mashey shell, included more advanced flow-control mechanisms and introduced shell variables, but remained limited by the necessity to remain compatible with the Thompson shell. Finally, the Thompson shell was replaced as the main Unix shell by the
Bourne shell The Bourne shell (sh) is a Shell (computing), shell Command-line interface#Command-line interpreter, command-line interpreter for computer operating systems. The Bourne shell was the default Unix shell, shell for Version 7 Unix. Unix-like syste ...
in
Version 7 Unix Seventh Edition Unix, also called Version 7 Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercial ...
and the
C shell The C shell (csh or the improved version, tcsh) is a Unix shell created by Bill Joy while he was a graduate student at University of California, Berkeley in the late 1970s. It has been widely distributed, beginning with the 2BSD release of the ...
in 2BSD, both released in 1979. Since virtually all modern Unix and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems are descended from V7 and 2BSD, the Thompson shell is generally no longer used. It is, however, available as
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
as part of several
Ancient Unix Ancient UNIX is any early release of the Unix code base prior to Unix System III, particularly the Research Unix releases prior to and including Version 7 (the base for UNIX/32V as well as later developments of AT&T Unix). After the publicati ...
source distributions, and has been ported to modern Unices as a historical exhibit.


See also

*
Comparison of command shells A command shell is a command-line interface to interact with and manipulate a computer's operating system. General characteristics Interactive features Background execution Background execution allows a shell to run a command without us ...


References


External links


Manual page for the Thompson shell in Unix 1st Edition


- describes the early development of the shell

- manual pages for the 3rd, 4th, and 6th edition Thompson shells, and other resources on the early shells
Sixth Edition Thompson Shell Port
- the Thompson shell and its associated utilities ported to modern Unix systems {{Ken Thompson navbox Unix shells